#include "soapWebService1SoapProxy.h"
#include "WebService1Soap.nsmap"

using std::cout;
using std::endl;
using std::cerr;

int main() 
{
    WebService1SoapProxy proxy(SOAP_C_UTFSTRING);
    _ns1__HelloWorldResponse result;

    if(proxy.HelloWorld(NULL, &result) == SOAP_OK)
    {
        cout<<"call successfully"<<endl;
        cout<<*result.HelloWorldResult<<endl;
    }
    else
    {
        cerr<<"call failed"<<endl;
    }

    _ns1__lotteryNameData lottery_name;
    std::string slottery_name("上海时时乐");

    lottery_name.lotteryName = &slottery_name;
    _ns1__lotteryNameDataResponse lottery_name_response;
    int ret = proxy.lotteryNameData(&lottery_name, &lottery_name_response);
    cout<<ret<<endl;
    if(ret == SOAP_OK)
    {
        cout<<"call successfully"<<endl;
        cout<<*lottery_name_response.lotteryNameDataResult<<endl;
    }
    else
    {
        cerr<<"call failed"<<endl;
        const char* result = proxy.soap_fault_string();
        cout<<result<<endl;

        result = proxy.soap_fault_detail();
        cout<<result<<endl;
    }
    std::string lname(*lottery_name_response.lotteryNameDataResult);
    cout<<lname<<endl;

    return 0;
}   
